package cn.highedu.democlient.demo;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class FeignServiceClient {

    private Logger logger = LoggerFactory.getLogger(FeignServiceClient.class);

    @Autowired
    private FeignService feignService;

    @GetMapping("/feign/hello/{name}")
    public String feignHello(@PathVariable String name) {
        logger.info("feignClient name: {}", name);
        return feignService.hello(name) + " from feign client";
    }
}
